package org.comanche.snaf.core.service;

import java.net.SocketAddress;

import org.comanche.snaf.core.handler.SessionHandler;

/**
 * This is the acceptor service deifne
 * 
 * @author joe_zhou
 *
 */
public interface Acceptor {
	
	/**
	 * 
	 * @return
	 */
	public boolean isReuseAddress();
	
	/**
	 * 
	 * @param reuse
	 */
	public void setReuseAddress(boolean reuseAddress);
	
	/**
	 * use the default address to bind
	 */
	public void bind();
	
	/**
	 * bind address as input parameter
	 * 
	 * @param localAddress
	 */
	public void bind(SocketAddress localAddress);
	
	/**
	 * unbind all the local address and close all
	 * the incoming connects.
	 */
	public void unbind();
	
	/**
	 * unbind the address which the user inputs
	 * 
	 * @param localAddress
	 */
	public void unbind(SocketAddress localAddress);
	
	/**
	 * 
	 * @param localAddress
	 */
	public void setDefaultLocalAddress(SocketAddress localAddress);
	
	/**
	 * 
	 * @return
	 */
	public SocketAddress getDefaultLocalAddress();
	
	/**
	 * 
	 * @param handlder
	 */
	public void setHandler(SessionHandler handler);
	
	/**
	 * 
	 * @return
	 */
	public SessionHandler getHandler();
}
